<template>
  <div>
    <el-card shadow="never">
      <h3>投票广场</h3>
    </el-card>
    <br>
    <el-card shadow="never">
      <div v-for="item in voteList" :key="item.id">
        <!-- <el-form size="mini">
          <div style="font-size:14px;display:flex;align-items:center;margin-bottom:16px; color:#666;">
            <img style="border-radius:50%;" height="35" width="35" :src="item.user.avatar" alt="">
            <span style="padding-left:8px">{{ item.user.nickName }}</span>
            <span style="padding-left:8px;">发起于</span>
            <span style="padding-left:8px;">{{ item.createTime }}</span>
            <el-tag v-if="item.state===0" size="mini" style="margin-left:8px;" type="success">进行中</el-tag>
            <el-tag v-if="item.state===1" size="mini" style="margin-left:8px;" type="danger">已结束</el-tag>
          </div>
          <el-form-item label="投票标题">
            <span> {{ item.title }}</span>
          </el-form-item>
          <el-form-item label="投票描述">
            <span> {{ item.desc }}</span>
          </el-form-item>
          <div>
            <el-button type="text" @click="joinBtn(item)"> 参与投票 </el-button>
          </div>
        </el-form> -->
        <vote-card :vote="item" />
        <el-divider />
      </div>
    </el-card>

  </div>
</template>

<script>
import * as voteApi from '@/api/vote'
import VoteCard from '@/views/front/components/VoteCard'
export default {
  name: '',
  components: {
    VoteCard
  },
  data() {
    return {
      voteList: []

    }
  },
  created() {
    voteApi.list().then(resp => {
      this.voteList = resp.data
    })
  },
  methods: {
    // joinBtn(vote) {
    //   this.current = vote
    //   this.joinVisible = true
    // }

  }
}
</script>

<style lang="scss" scoped>
::v-deep .el-radio{
  display: block;
  height: 30px;
}

.item-choose{
  height: 30px;
}
</style>
